//
//  RechargeItem.m
//  UniversalApp
//
//  Created by 志刚杨 on 2018/1/30.
//  Copyright © 2018年 voidcat. All rights reserved.
//

#import "RechargeItem.h"

@implementation RechargeItem
{
    UILabel *labMoney;
    UILabel *labCoin;
}
-(void)initWithMoney:(NSString *)money andCoin:(NSString *)coin
{
    self.frame = CGRectMake(0, 0, SCREEN_WIDTH/3-15, 70);
    self.backgroundColor = [UIColor colorWithHexString:@"FFD1E1"];
    ViewBorderRadius(self, 2, 1.2, MainColor);
    
    //添加金额
    labMoney = [[UILabel alloc] init];
    labMoney.text = money;
    labMoney.font = DEFAULT_FONT(16);
    [self addSubview:labMoney];
    
    //添加金币数量
    labCoin = [[UILabel alloc] init];
    labCoin.text = coin;
    labCoin.font = DEFAULT_FONT(13);
    labCoin.textColor = MainColor;
    [self addSubview:labCoin];
    
    [self setupUILayout];
}

-(void)setupUILayout
{
    [labMoney mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self).offset(10);
    }];
    
    [labCoin mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(labMoney.mas_bottom).offset(10);
    }];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
